<?php

/**
 * DetalleRuta form base class.
 *
 * @method DetalleRuta getObject() Returns the current form's model object
 *
 * @package    sysdoc-v.1
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseDetalleRutaForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id_hoja_de_ruta'      => new sfWidgetFormInputHidden(),
      'id_documento_enviado' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Tramite'), 'add_empty' => false)),
      'numero_ruta'          => new sfWidgetFormInputText(),
      'origen'               => new sfWidgetFormTextarea(),
      'destino'              => new sfWidgetFormTextarea(),
      'firma'                => new sfWidgetFormTextarea(),
      'fecha_entrega'        => new sfWidgetFormDate(),
      'fecha_lectura'        => new sfWidgetFormDate(),
    ));
    $this->setValidators(array(
      'id_hoja_de_ruta'      => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id_hoja_de_ruta')), 'empty_value' => $this->getObject()->get('id_hoja_de_ruta'), 'required' => false)),
      'id_documento_enviado' => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Tramite'))),
      'numero_ruta'          => new sfValidatorInteger(),
      'origen'               => new sfValidatorString(),
      'destino'              => new sfValidatorString(),
      'firma'                => new sfValidatorString(),
      'fecha_entrega'        => new sfValidatorDate(),
      'fecha_lectura'        => new sfValidatorDate(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('detalle_ruta[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'DetalleRuta';
  }

}
